import Vue from "vue";
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
import './assets/reset.css'
import './assets/iconfont/iconfont.css'
//import './assets/zjborder.css'
import 'mint-ui/lib/style.css'
//import './assets/mixin.styl'
import loading from './assets/loading.gif'
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
    loading
});

import {Swipe, SwipeItem, Button} from 'mint-ui';

Vue.component(Button.name, Button);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);

Vue.config.productionTip = false;
//直接加载mockServer即可，比较特殊，不需要暴露
import './mock/mockServe.js'

//过滤时间格式
import './filter/filter.js'

(function () {
    function rem() {
        var html = document.documentElement || document.body;
        var htmlWidth = html.clientWidth;
        if (htmlWidth == 0) {
            html.style.fontSize = 100 / 7.5 + 'vw';
        } else {
            html.style.fontSize = (htmlWidth / 750) * 100 + "px"
        }
    }
window.addEventListener('resize',rem);
    rem()
})();

// Vue.directive(focus,{
//     inserted:()=>{
//         el.focus()
//     }
//
// });
Vue.directive('focus', {
    // 当被绑定的元素插入到 DOM 中时……
    inserted: function (el) {
        // 聚焦元素
        el.focus()
    }
});


new Vue({

    router,
    store,
    render: h => h(App)
}).$mount("#app");
